import { Controller, Get } from '@nestjs/common';
import { CommonServiceService } from './common-service.service';
import { MessagePattern } from '@nestjs/microservices';

@Controller()
export class CommonServiceController {
  constructor(private readonly commonServiceService: CommonServiceService) {}

  // @Get()
  // getHello(): string {
  //   return this.commonServiceService.getHello();
  // }
  @MessagePattern({ cmd: 'sum2' })
  async sum2() {
    return 'i am from  common-service2'
  }
  @MessagePattern({ cmd: 'sum' })
  async sum() {
    return 'i am from  common-service'
  }
}
